package org.threads.banktransactions;

public class RemittanceTask implements Runnable {

    private final Bank bank;
    private final Account from;
    private final Account to;
    private final int amount;

    public RemittanceTask(Bank bank, Account from,
                          Account to, int amount) {
        this.bank = bank;
        this.from = from;
        this.to = to;
        this.amount = amount;
    }

    @Override
    public void run() {
        bank.transfer(from, to, amount);
    }
}
